#ifndef _LED_H_
#define	_LED_H_

//--------------------test----------------------------------------------------------
// Makrodefinitionen
//------------------------------------------------------------------------------

#define PIOA_BASE (0xFFFFF400)
#define PIOB_BASE (0xFFFFF600) // Gelb LED am Controller B
#define PIOC_BASE (0xFFFFF800) // Rot und grüne LED am Controller C
#define PIOD_BASE (0xFFFFFA00)

#define PIOB_PER  (volatile unsigned int*)(PIOB_BASE + 0x00)
#define PIOB_OER  (volatile unsigned int*)(PIOB_BASE + 0x10)
#define PIOB_SODR (volatile unsigned int*)(PIOB_BASE + 0x30)
#define PIOB_CODR (volatile unsigned int*)(PIOB_BASE + 0x34)


#define PIOC_PER  (volatile unsigned int*)(PIOC_BASE + 0x00)
#define PIOC_OER  (volatile unsigned int*)(PIOC_BASE + 0x10)
#define PIOC_SODR (volatile unsigned int*)(PIOC_BASE + 0x30)
#define PIOC_CODR (volatile unsigned int*)(PIOC_BASE + 0x34)
#define PIOC_PDR  (volatile unsigned int*)(PIOC_BASE + 0x04)

// E/A-Leitung, an welcher die gelbe LED angeschlossen ist
#define YELLOW_LED_BIT (1 << 27)

// Rot
#define RED_LED_BIT (1 << 0)

// Grüne Lichtemittierende Diode
#define GREEN_LED_BIT (1 << 1)
//------------------------------------------------------------------------------
// Funktionsdeklarationen
//------------------------------------------------------------------------------

void init_yellow_led();
void switch_yellow_led_on();
void switch_yellow_led_off();

void init_red_led();
void switch_red_led_on();
void switch_red_led_off();

void init_green_led();
void disable_green_led();
void switch_green_led_on();
void switch_green_led_off();

#endif // _LED_H_

